package Game;

public enum ActionType {
    /*
        此处新增的RotateBack，方便“回滚”
    */
    UP , DOWN , LEFT , RIGHT , ROTATE , ROTATE_BACK, NONE;

    public static ActionType getInverse(ActionType action){
        if (action == UP){
            return DOWN;
        }
        if (action == DOWN){
            return UP ;
        }
        if (action == LEFT){
            return RIGHT;
        }
        if (action == RIGHT){
            return LEFT;
        }
        if (action == ROTATE){
            return ROTATE_BACK;
        }
        if (action == ROTATE_BACK){
            return ROTATE;
        }
        return NONE;
    }

}
